---
title: How to create an application with protected routes using the Authenticator component
description: How to protect routes with Amplify Authenticator.
supportedFrameworks: react
---

import { Fragment } from '@/components/Fragment';

import { getCustomStaticPath } from '@/utils/getCustomStaticPath';


export async function getStaticPaths() {
  return getCustomStaticPath(frontmatter.supportedFrameworks);
}

{/*  `getStaticProps` is required to prevent "Error: getStaticPaths was added without a getStaticProps. Without getStaticProps, getStaticPaths does nothing" */}

export async function getStaticProps() {
  return { props: {} }
}

<Fragment>
  {({ platform }) => import(`./auth-protected.${platform}.mdx`)}
</Fragment>
